#include <stdio.h>

int main(){
    int x=123,ret=0,n,i,x1;
    x1=x;
    for ( n=0;x>0;n++ ){
    	x /= 10;
	}
	for ( i=0;i<n;i++ ){
		ret += ret*10 + x1%10;
		x1 /= 10;
	}
	return ret;
}
